home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
turble.arc
/
ASPECT.PAS
next >
Wrap
Pascal/Delphi Source File
|
1986-03-31
|
2KB
|
59 lines
Program Aspect;
Var
Width, Height, Aspect : Real;
Ch : Char;
YMax : Integer;
{This program calculates the aspect and the maximum number of
vertical pixels on your screen. Notice that the program takes
a couple extra pixels off the calculated maximum and rounds to
an even number. I found that the bottom few pixels didn't show
up on my screen. Your screen might show them. }
begin
GraphMode;
Draw(160,10,160,190,1); {Draw test lines. }
Draw(70,100,250,100,1);
GotoXY(1,2);
Writeln('Measure the ');
Writeln('horizontal line ');
Writeln('with as much ');
Writeln('precision as ');
Writeln('you can.');
Writeln;
Writeln('Enter width ');
Writeln('as a decimal ');
Write('fraction: ');
Readln(width);
GotoXY(1,2);
Writeln('Measure the ');
Writeln('vertical line ');
Writeln('with as much ');
Writeln('precision as ');
Writeln('you can.');
Writeln;
Writeln(' ');
Writeln('Enter height ');
Writeln('as a decimal ');
Write('fraction: ');
Readln(Height);
TextMode(BW80);
GotoXY(1,10);
Aspect := Width / Height; {Calculate aspect. Calculate... }
YMax := Trunc(200 / Aspect) - 2; {...maximum Y and subtract 2 extra.}
If Odd(YMax) then YMax := YMax - 1; {Round to even number. }
Writeln('ScrunchUp = ',Aspect:3:2,';');
Writeln('HiYMax = ',2 * YMax);
Writeln;
Writeln('Write these numbers down or do a screen print. ');
Writeln('Then type them in as the constants in the first few');
Writeln('lines of the Turble Graphics include module.');
Writeln;
Writeln('Press any key to end. ');
Read(Kbd,Ch);
ClrScr;
end.